cmake_minimum_required (VERSION 2.8)

#requires PCL
find_package(PCL REQUIRED)

include_directories( ${CMAKE_CURRENT_SOURCE_DIR} )
include_directories( ${CMAKE_CURRENT_BINARY_DIR} )
include_directories( ${EXTERNAL_LIBS_INCLUDE_DIR} )
include_directories( ${CC_DLL_SOURCE_DIR}/include )
include_directories( ${QCC_DB_DLL_SOURCE_DIR} )
if( MSVC )
include_directories( ${QCC_DB_DLL_SOURCE_DIR}/msvc )
endif()
include_directories(${PCL_INCLUDE_DIRS})
include_directories(filters)
include_directories(filters/dialogs)
include_directories(utils)

project( PclUtils )

#include_directories( ${qCC_SOURCE_DIR} )
#include_directories( ${qCC_BINARY_DIR} )

#include_directories(${CMAKE_CURRENT_BINARY_DIR})
#include_directories(${CMAKE_CURRENT_BINARY_DIR}/filters/dialogs)
#include_directories(${CMAKE_CURRENT_BINARY_DIR}/filters)

#include_directories( ${qCC_SOURCE_DIR}/plugins )

file( GLOB header_list filters/*.h filters/dialogs/*.h utils/*.h)
file( GLOB source_list filters/*.cpp filters/dialogs/*.cpp utils/*.cpp)
file( GLOB ui_list filters/dialogs/*.ui )
#file( GLOB qrc_list icons/*.qrc )
#file( GLOB rc_list *.rc )

# find Qt mocable files
find_mocable_files( mocable_list ${header_list} )
qt4_wrap_cpp( moc_list ${mocable_list}  OPTIONS -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED)
QT4_WRAP_UI( generated_ui_list ${ui_list} )
#QT4_ADD_RESOURCES( generated_qrc_list ${qrc_list} )

SOURCE_GROUP("Resources" FILES
  ${ui_list}
)

SOURCE_GROUP("Generated" FILES
  ${generated_ui_list}
  ${moc_list}
)

#add_library( ${PROJECT_NAME} STATIC ${header_list} ${source_list} ${moc_list} ${generated_ui_list} ${generated_qrc_list} ${rc_list})
add_library( ${PROJECT_NAME} STATIC ${header_list} ${source_list} ${moc_list} ${generated_ui_list} )

# Default preprocessors
set_default_cc_preproc( ${PROJECT_NAME} )

# Add custom prepocessor definitions
if (WIN32)
	set_property( TARGET ${PROJECT_NAME} APPEND PROPERTY COMPILE_DEFINITIONS CC_USE_AS_DLL QCC_DB_USE_AS_DLL )
endif()
ADD_DEFINITIONS(-DQT_GUI_LIBS -DQT_CORE_LIB -DQT3_SUPPORT)
link_directories( ${PCL_LIBRARY_DIRS} )
add_definitions( ${PCL_DEFINITIONS} )
target_link_libraries( ${PROJECT_NAME} ${PCL_LIBRARIES} 
						QVTK
						vtkRendering
						vtkGraphics
						vtkIO
						vtkCommon
						vtkInfovis
						vtkViews			)
